package com.sprouting.ops.model;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sprouting.ops.annotations.invoke.CheckIsNullOrEmpty;
import com.sprouting.ops.annotations.invoke.CheckLength;
import com.sprouting.ops.annotations.invoke.CheckNotNull;
import com.sprouting.ops.interfaces.AddGroup;
import com.sprouting.ops.interfaces.UpdGroup;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * (现场故障上报)表实体类
 * 暂不使用,故障上报没这么简单，有核验、复现、检测、分配之类的流程
 *
 * @author longx
 * @since 2023-11-20 17:56:36
 */
@Deprecated
@Data
@TableName("ops_site_fault")
public class OpsSiteFault extends BaseModel {

    /**
     * 主键
     */
    @CheckNotNull(message = "非法ID", groups = UpdGroup.class)
    @CheckIsNullOrEmpty(message = "无效ID", groups = AddGroup.class)
    @TableId
    private String id;
    /**
     * 部署应用ID
     */
    @CheckNotNull(message = "请选择应用")
    private String appDeployId;
    /**
     * 故障级别
     * @see com.sprouting.ops.interfaces.ConstantBase.FaultLevel
     */
    private Integer level;
    /**
     * 故障类型，bug，安全升级
     * @see com.sprouting.ops.interfaces.ConstantBase.FaultType
     */
    @NotNull(message = "请选择故障类型")
    private Integer faultType;
    /**
     * 上报故障人ID
     * @see OpsUser#getId()
     */
    private String userId;
    /**
     * 上报故障人姓名
     * @see OpsUser#getName()
     */
    private String userName;
    /**
     * 故障描述
     */
    @CheckLength(min = 1, max = 1000, message = "故障描述超过长度限制")
    @CheckNotNull(message = "请输入故障描述")
    private String description;
    /**
     * 问题重现方式
     */
    @CheckLength(min = 1, max = 21840, message = "问题重现方式超过长度限制")
    @CheckNotNull(message = "请输入问题重现方式")
    private String problemRecurrence;
    /**
     * 解决方案
     */
    @CheckLength(max = 21840, message = "解决方案超过长度限制")
    private String solution;
    /**
     * 故障原因
     */
    @CheckLength(max = 1000, message = "故障原因超过长度限制")
    private String reason;
    /**
     * 发现问题时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
    private Date discoverTime;
    /**
     * 故障上报时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date reportingTime;
    /**
     * 要求解决时间，非必填
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
    private Date requiredTime;
    /**
     * 解决时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date solutionTime;
    /**
     * 解决人用户ID
     * @see OpsUser#getId()
     */
    @CheckNotNull(message = "请选择解决人")
    private String solutionUserid;
    /**
     * 问题结论
     */
    @CheckLength(max = 1000, message = "问题结论超过长度限制")
    private String conclusion;
    /**
     * 解决人 问题状态,;确认、修复、复测、修复成功
     * @see com.sprouting.ops.interfaces.ConstantBase.SolutionStatus
     */
    private Integer solutionStatus;
    /**
     * 问题复核
     * 对问题复盘
     */
    @CheckLength(max = 1000, message = "问题复核超过长度限制")
    private String reviewStatus;
    /**
     * 该问题最终解决状态
     * @see com.sprouting.ops.interfaces.ConstantBase.SolutionStatus#SUCCESS
     * @see com.sprouting.ops.interfaces.ConstantBase.SolutionStatus#EXIST
     */
    private Integer status;

}

